import { BasicColumn, FormSchema } from '/@/components/Table';
import { rules } from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';

export const columns: BasicColumn[] = [
  {
    title: '组名称',
    width: 160,
    dataIndex: 'name',
  },
  {
    title: '默认',
    dataIndex: 'isDefault',
    width: 60,
    customRender: ({text}) => {
      return render.renderTag(render.renderDict(text, 'bool_value'), 'green')
    }
  },
  {
    title: '备注',
    width: 120,
    dataIndex: 'remark',
  },

  {
    title: '创建时间',
    width: 150,
    dataIndex: 'createdAt',
  },
  {
    title: '创建者',
    width: 90,
    dataIndex: 'createdBy',
  }
];

export const searchFormSchema: FormSchema[] = [
  {
    field: 'name',
    label: '名称',
    component: 'Input',
    // colProps: {span: 6},
  }
];

export const configGroupFormSchema: FormSchema[] = [
  {
    label: 'id',
    field: 'id',
    component: 'Input',
    show: false
  },
  {
    field: 'name',
    label: '名称',
    component: 'Input',
    required: true
  },

  {
    field: 'isDefault',
    label: '默认',
    required: true,
    component: 'JDictSelectTag',
    defaultValue:'0',
    componentProps: {
      type:'radio',
      dictCode:'bool_value',
    },
  },
  {
    field: 'remark',
    label: '备注',
    component: 'InputTextArea',
    componentProps: {
      autoSize: {
        minRows: 5,
        maxRows: 5
      }
    },
    required: false
  },
]
